package Test;

import static org.junit.Assert.*;

import java.io.File;
import java.io.FileNotFoundException;

import org.junit.Test;

import Script.TextReader;

public class TextReaderTest {
	String sep = System.getProperty("line.separator");
	String charset;
	
	@Test
	public void canReadLatinText() throws FileNotFoundException {
		File script = new File("testFiles/testScripts/Script7.txt");
		String expected = "<PT0001>Clean";
		charset = "ISO-8859-1";
		
		assertEquals(expected, TextReader.getText(script, charset));
	}
	
	@Test
	public void canReadJapaneseText() throws FileNotFoundException {
		File script = new File("testFiles/testScripts/Script13.txt");
		String expected = "真真";
		charset = "UTF-16";
		String result = TextReader.getText(script, charset);
		
		assertEquals(expected, result);
	}
}
